Skip to content

Add CAN Layer2 Signal Based Logging example#4

Open
em1064 wants to merge 1 commit intoProemion:mainfrom
em1064:add-can-layer2-signal-logging
Open

Add CAN Layer2 Signal Based Logging example#4
em1064 wants to merge 1 commit intoProemion:mainfrom
em1064:add-can-layer2-signal-logging

Conversation

@em1064
Copy link
Copy Markdown

@em1064 em1064 commented Apr 13, 2026

Adds a new example demonstrating the Proemion CAN Layer 2 library
(V0.1.0.1) for signal-based logging using a delta-anchor threshold
strategy. Includes the compiled library, a complete self-contained
project archive (SalesDemo), and full documentation covering
FB_CAN_Setup, FB_CAN_Rx_Signal_REAL, FB_DeltaAnchorTrigger, and
FB_SignalTriggeredLogger.

Also updates .gitignore and .gitattributes to support the
.compiled-library file type.

Adds a new example demonstrating the Proemion CAN Layer 2 library
  (V0.1.0.1) for signal-based logging using a delta-anchor threshold
  strategy. Includes the compiled library, a complete self-contained
  project archive (SalesDemo), and full documentation covering
  FB_CAN_Setup, FB_CAN_Rx_Signal_REAL, FB_DeltaAnchorTrigger, and
  FB_SignalTriggeredLogger.

  Also updates .gitignore and .gitattributes to support the
  .compiled-library file type.
@RaulSMS RaulSMS requested review from RaulSMS and VKlueber April 13, 2026 15:04
Copy link
Copy Markdown
Collaborator

@RaulSMS RaulSMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@em1064 thanks a lot, looks good, and the README is clear.

Nothing to add.

@RaulSMS
Copy link
Copy Markdown
Collaborator

RaulSMS commented Apr 13, 2026

@VKlueber if you want to checkout the changes, and since the branch comes from a fork from @em1064 you will not see the branch on the repo. But you can get it by git fetch origin pull/4/head:pr-4
This will create a local branch pr-4


Instead of logging every CAN frame at a fixed rate, the library's `FB_DeltaAnchorTrigger` only fires when a signal deviates from its last logged value (the "anchor") by more than a configurable `Delta`. An optional `MinTime_ms` debounces fast oscillations around a threshold; `MaxTime_ms` forces a log entry even if the signal is stable — ensuring heartbeat records.

The `SalesDemo_Example` project shows this pattern across multiple CAN networks and signal types on a **Proemion CANlink mobile 10000** device.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to rename the Project to CANLayer2_Example.


| File | Description |
|------|-------------|
| `Proemion_CAN.compiled-library` | Compiled Proemion CAN Layer 2 library (V0.1.0.1). Install into Codesys before opening the example. |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this library is not an official product from Proemion I propose to rename it to something like CANlink_CAN and remove the name Proemion everywhere:

Image


---

## Installing the Library
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the way how libraries are being installed at CODESYS might change in the future I propose to refer to the way how libraries are installed in CODESYS.


---

## Function Blocks
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the function block documentation is included in the library I propose to not have it also here. This would require to maintain it at both places.

@VKlueber
Copy link
Copy Markdown
Collaborator

I was able to compile the project 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants